|
|
|
|
|
|
|
Learn object-oriented terminology |
|
|
|
|
|
|
|
|
Learn to create class modules |
|
|
|
|
|
|
|
|
Learn to create some reusable classes |
|
|
|
|
|
|
|
|
Defining Object-based Programming |
|
|
|
|
|
|
|
|
Object-based programming (OBP) is a method of software design and construction. Its the next logical progression from structured programming, and it improves your code reusability and maintainability. |
|
|
|
|
|
|
|
|
Object-based programming and object-oriented programming (OOP) are very similar, but Visual Basic is not an object-oriented language. Instead, it has an object-like syntax and can deal with objects that you create or ones that have already been created. In this chapter, I use the term OOP to refer to both object-oriented and object-based programming. |
|
|
|
|
|
|
|
|
Object-based programming is simply a method of designing individual software components (classes) with associated behaviors (methods) and data (properties) and then piecing these components together to create a complete application. |
|
|
|
|
|
|
|
|
Objects are designed and implemented as individual units that accomplish a specific task, or tasks, independent of any other objects or code within an application. OOP languages were designed with a windowing environment in mind. The complexities of dealing with windows makes the OOP paradigm almost a necessity. |
|
|
|
|
|
|
|
|
When moving to any new software development method, such as OOP, you must learn some new terms. These terms may seem strange at first, but I think youll find that most of them relate to concepts youve probably already implemented in your existing applications. Lets take a look at each of the new terms. |
|
|
|
|
|
|
|
|
A class is a template or blueprint for how an object will look and behave at runtime. The class contains all the methods and properties (code and data) for an instance of an object. Think of a class as a cookie cutter. This cookie cutter can be used to make as many cookies as you want. All the cookies will look exactly alike immediately after you cut them. |
|
|
|
|
|